Skip to content

Hibernate 7 - Step 1#15654

Merged
jdaugherty merged 90 commits into
8.0.xfrom
8.0.x-stage-hibernate7
Jun 4, 2026
Merged

Hibernate 7 - Step 1#15654
jdaugherty merged 90 commits into
8.0.xfrom
8.0.x-stage-hibernate7

Conversation

@jdaugherty

@jdaugherty jdaugherty commented May 11, 2026

Copy link
Copy Markdown
Contributor

creating this request by cloning the existing hibernate five modules so that we can easily review the hibernate seven changes between hibernate five and seven

Copy all source, test examples, BOMs, and build config from the
hibernate5 namespace to hibernate7 so that the real hibernate7 PR
can be reviewed as a true delta rather than a sea of new files.

Modules added:

  • grails-hibernate7-bom (copy of grails-hibernate5-bom)
  • grails-data-hibernate7-core, spring-orm, grails-plugin, dbmigration, spring-boot, docs
  • grails-test-examples/hibernate7 (12 projects mirroring hibernate5)
  • gradle/hibernate7-test-config.gradle (skipHibernate7Tests flag)

Build infrastructure:

  • publish-root-config.gradle: register hibernate7 modules for publishing
  • SbomPlugin.groovy: add LGPL exemptions for hibernate5 artifacts used by hibernate7 staging modules
  • settings.gradle: include all hibernate7 projects

Copy all source, test examples, BOMs, and build config from the
hibernate5 namespace to hibernate7 so that the real hibernate7 PR
can be reviewed as a true delta rather than a sea of new files.

Modules added:
- grails-hibernate7-bom (copy of grails-hibernate5-bom)
- grails-data-hibernate7-core, spring-orm, grails-plugin, dbmigration, spring-boot, docs
- grails-test-examples/hibernate7 (12 projects mirroring hibernate5)
- gradle/hibernate7-test-config.gradle (skipHibernate7Tests flag)

Build infrastructure:
- publish-root-config.gradle: register hibernate7 modules for publishing
- SbomPlugin.groovy: add LGPL exemptions for hibernate5 artifacts used by hibernate7 staging modules
- settings.gradle: include all hibernate7 projects
@jdaugherty jdaugherty requested a review from jamesfredley May 12, 2026 01:40
@jdaugherty

Copy link
Copy Markdown
Contributor Author

This PR is #1 for the hibernate PR. Basically, I cloned the hibernate5 projects and then created this PR as if they were the hibernate 7 artifacts. This then allows the actual hibernate PR to be meaningful since we can better see what changed. It's not perfect, but it did cut out about 400+ files to review this way.

@jdaugherty

Copy link
Copy Markdown
Contributor Author

I went ahead and renamed hibernate6.gorm.suite to hibernate7.gorm.suite in this initial PR since otherwise the tests will fail that are ignored.

@jdaugherty jdaugherty changed the title stage: clone hibernate5 modules to hibernate7 as baseline Hibernate 7 - Step 1 May 12, 2026

@matrei matrei left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you @jdaugherty !

There are some TCK tests that are failing because they only have
@IgnoreIf({ System.getProperty('hibernate5.gorm.suite') })
and not
@IgnoreIf({ System.getProperty('hibernate7.gorm.suite') })

@jdaugherty

Copy link
Copy Markdown
Contributor Author

Per discussion, I've pulled forward the addAllDomainClasses, the common base spec for mongo, & the package renames from tests -> specs

@jdaugherty jdaugherty requested a review from borinquenkid May 12, 2026 14:32
@jdaugherty jdaugherty force-pushed the 8.0.x-stage-hibernate7 branch from 06fe15d to f18465a Compare May 12, 2026 15:20
@matrei

matrei commented May 13, 2026

Copy link
Copy Markdown
Contributor

Should commit 06fe15d be on this branch?

@jdaugherty

Copy link
Copy Markdown
Contributor Author

@matrei i had removed it from this branch since it's to fix the datastore changes in the other branch.

@jdaugherty

Copy link
Copy Markdown
Contributor Author

@matrei Actually, it looks like it got readded somehow, let me try to take it off again

@jdaugherty jdaugherty force-pushed the 8.0.x-stage-hibernate7 branch from 6783934 to 4c5c563 Compare May 13, 2026 18:58
@jdaugherty

Copy link
Copy Markdown
Contributor Author

@matrei I believe I have removed this now.

Comment thread gradle/functional-test-config.gradle Outdated
…R-F #15689)

Continues shrinking the PR-A review surface, matching the established
B/C/D/E revert pattern. Once these land on 8.0.x and 8.0.x is merged
back into this branch, the reverted changes return through the merge, so
the final state of stage-hibernate7 is unchanged - only the diff visible
on PR-A is reduced.

Reverted content:

  grails.gorm.tests -> grails.gorm.specs package rename (PR #15688, PR-I)
    Renames the test package back to grails.gorm.tests (the 8.0.x
    convention) across the three affected test trees: hibernate5 core
    (90 files), hibernate7 core (90 files), and grails-datamapping-core-test
    (18 files). The mongo portion was already reverted in the prior
    B/C/D/E revert.

  Hibernate 5 Micronaut BOM split (PR #15689, PR-F)
    Removes grails-hibernate5-micronaut-bom, its sample app
    (micronaut-hibernate5), and all h5-micronaut references in
    settings.gradle, dependencies.gradle, publish-root-config.gradle,
    validateMicronautBom, the doc-generation task, and the Micronaut
    config/upgrade guides. The generic grails-micronaut-bom is retained.

NOT reverted (intentionally kept - the actual PR-A work):
  - The hibernate5 -> hibernate7 baseline clone
  - grails-hibernate7-micronaut-bom, its sample app, and all h7
    references (settings/dependencies/publish/plugin/doc-gen/guides)

Verified: ./gradlew help configures cleanly; compileTestGroovy passes for
grails-datamapping-core-test, grails-data-hibernate5-core, and
grails-data-hibernate7-core (the three renamed trees); grails-hibernate7
-micronaut-bom still publishes.

Assisted-by: claude-code:claude-4.7-opus
@jamesfredley

Copy link
Copy Markdown
Contributor

Carve-out complete - detailed merge order

All the changes that @matrei asked to be reviewed independently have now been carved out of this PR into focused, single-topic PRs. This comment is the authoritative merge order and a conservation check confirming nothing was lost.

The full stack

PR Topic State Base
#15682 (PR-B) Async defensive cleanup Merged 8.0.x
#15683 (PR-C) addAllDomainClasses TCK helper Open 8.0.x
#15684 (PR-D) DetachedCriteriaSpec command-chain style Open 8.0.x
#15685 (PR-E) MongoDatastoreSpec base class + mongo package rename Open 8.0.x
#15689 (PR-F) grails-hibernate5-micronaut BOM (Micronaut BOM split) Open 8.0.x
#15686 (PR-G) grails-code-analysis plugin + violation aggregation Open 8.0.x
#15687 (PR-H) grails-jacoco plugin + Codecov coverage Open feat/grails-code-analysis-plugin (PR-G)
#15688 (PR-I) grails.gorm.tests -> grails.gorm.specs rename Draft 8.0.x

Dependencies

  • PR-H depends on PR-G - it targets PR-G's branch. Either merge PR-G first then retarget PR-H to 8.0.x, or merge them in order.
  • PR-I is a draft pending the naming-convention discussion (@borinquenkid). Nothing else depends on it.
  • B, C, D, E, F, G are mutually independent and can land in any order.

How this PR was reduced

Each carved topic was reverted on this branch (8.0.x-stage-hibernate7) via three revert commits, matching the original B/C/D/E pattern:

  • ba235da8f7 - B/C/D/E (async, TCK helper, DetachedCriteria style, mongo base class + mongo rename)
  • 33412eebc7 - G/H (code-analysis + jacoco infrastructure)
  • f0d82f64b8 - F/I (h5 Micronaut BOM split + specs -> tests rename for the hibernate5 and datamapping test trees)

The reverts only shrink this PR's visible diff. Once a carved PR lands on 8.0.x and 8.0.x is merged back into this branch, the reverted content returns through the merge, so the final state of 8.0.x-stage-hibernate7 is unchanged.

Recommended merge sequence

  1. Land whichever of C, D, E, F the team approves on 8.0.x (independent; B already merged).
  2. Land G (code-analysis) on 8.0.x, then retarget H (jacoco) to 8.0.x and land it.
  3. If the team keeps the rename, land I (tests -> specs) on 8.0.x. If not, close it - this branch already reverted it, so no further action is needed here.
  4. Merge 8.0.x into 8.0.x-stage-hibernate7. The revert commits plus the incoming carved changes reconcile to the intended end state.
  5. Apply the Hibernate 7 mirror pass (see caveat below).
  6. Merge this PR (Hibernate 7 - Step 1 #15654) last, now reduced to the actual hibernate5 -> hibernate7 clone.
  7. Rebase Step 2 (#15568) on the updated stage branch.

Hibernate 7 mirror caveat (important)

The carved PRs are based on 8.0.x, which does not yet contain the Hibernate 7 modules. So three things that the carved PRs add to the hibernate5/original modules must be mirrored onto the hibernate7 clone modules after the merge-back, because no 8.0.x-based PR can touch files that only exist here:

  • the grails-code-analysis / grails-jacoco plugin apply-lines on the grails-data-hibernate7/* modules (and their PMD/SpotBugs opt-out gradle.properties), and
  • the grails.gorm.tests package naming on the hibernate7 core test tree, if PR-I lands.

These were removed here so this PR compiles cleanly without the carved plugins; re-applying them to the h7 clone is part of finalizing this PR after the merge-back, and keeps the h7 modules a faithful mirror of h5.

Conservation check

Every file the reverts removed from this branch is present in its standalone PR (verified): all grails-code-analysis / grails-jacoco / violation-aggregation sources, workflows, the PMD ruleset and plugin specs are in PR-G/PR-H; the h5 Micronaut BOM and its sample app are in PR-F; the specs/tests rename for h5 + datamapping is in PR-I (mongo in PR-E). All Hibernate 7-specific content - the h7 BOM, h7 Micronaut BOM, the micronaut-hibernate7 sample, and the grails-data-hibernate7/* modules - remains here on this PR.

Copilot review

All Copilot feedback across B-I has been addressed, replied to, and resolved (zero unresolved Copilot threads remain on any of them).

Resolve conflicts in gradle.properties (take gradleToolingApiVersion 9.5.1
from 8.0.x; keep hibernate5Version removed per Hibernate 7 step 1) and
grails-bom/micronaut/build.gradle (adopt updated comment documenting the
tools.jackson exclusion added on 8.0.x).

Assisted-by: claude-code:claude-4.8-opus
Commit ba235da reverted the addAllDomainClasses helper from
GrailsDataTckManager and its callers, but six grails-data-mongodb specs
were missed, leaving them calling a method that no longer exists. This
caused initializationError failures in :grails-data-mongodb-core:test
(MissingMethodException: GrailsDataMongoTckManager.addAllDomainClasses).

Restore these specs to use manager.domainClasses.addAll([...]) (identical
to the 8.0.x baseline and behaviorally equivalent to the removed helper),
so the branch compiles without the helper as intended. The helper and its
callers will return together when PR-C (#15683) lands on 8.0.x and is
merged back.

Assisted-by: claude-code:claude-4.8-opus
The hibernate7Functional job in gradle.yml retained unpinned action
references (actions/checkout@v6, actions/setup-java@v4,
gradle/actions/setup-gradle@v5.0.0) that are not on the ASF GitHub
Actions allow-list. Apache's org policy rejects non-allowlisted actions,
causing the entire 'CI' workflow (gradle.yml) to end in startup_failure
so none of its jobs ever ran.

Every other job in this file was already updated to ASF-approved,
SHA-pinned versions when 8.0.x was merged in; this aligns the
PR-specific hibernate7Functional job with its hibernate5Functional twin
(matching pins plus the cache-provider: basic option), allowing the
workflow to start.

Assisted-by: claude-code:claude-4.8-opus
@jdaugherty

Copy link
Copy Markdown
Contributor Author

I'm trying to understand what's been done here and what's been agreed to. Originally, I was under the impression we were going to split off changes into a merge chain. My assumption then was we would revert as we went, but the opposite has been done here. I think we need to discuss more on this before merging as a result. I'm not confident we have actually reverted what we've said without a more detailed review.

@jdaugherty

Copy link
Copy Markdown
Contributor Author

The micronaut-hibernate5-bom changes look to have been reverted, which is the wrong course of action. We have to split our boms so they set the right values when using a specific version of hibernate. I'm -1 on merging this until that's been restored.

@jdaugherty

Copy link
Copy Markdown
Contributor Author

@jamesfredley We should carve out the bom-split, jacoco, and the code-analysis changes as well revert the tests -> specs package change if possible.

@matrei the entire point of this PR originally was to clone & split the boms. Are you suggesting we should do these as 2 PRs? If so, why did we introduce the hibernate 7 bom in this PR?

borinquenkid pushed a commit that referenced this pull request Jun 1, 2026
Adds a grails-jacoco convention plugin that configures JaCoCo per subproject
and registers a root jacocoAggregateReport task producing a single XML report
for Codecov, handling the hibernate5/hibernate7 duplicate-class case. Applies
grails-jacoco to 96 subprojects and adds the Coverage workflow that uploads to
the existing codecov.yml configuration.

Layers on top of PR-G (grails-code-analysis / grails-violation-aggregation),
which provides the build-logic test infrastructure and plugin registration
scaffold. Folds in the standalone coverage work from #15668.

Extracted from the Hibernate 7 staging branch (PR #15654) per review feedback
that JaCoCo should be introduced as its own focused PR for the project to
review independently.

Assisted-by: claude-code:claude-4.7-opus
@jamesfredley

jamesfredley commented Jun 1, 2026

Copy link
Copy Markdown
Contributor
PR Topic State Base
#15682 (PR-B) Async defensive cleanup Merged 8.0.x
#15683 (PR-C) addAllDomainClasses TCK clean up to remove multiple domain add points Merged 8.0.x
#15684 (PR-D) DetachedCriteriaSpec method syntax change Agreement to Reject - Proposed for Later 8.0.x
#15685 (PR-E) MongoDatastoreSpec base class + mongo package rename Agreement to Reject - Propose for Later 8.0.x
#15689 (PR-F) grails-hibernate5-micronaut BOM (Micronaut BOM split) Merged 8.0.x
#15686 (PR-G) grails-code-analysis plugin + violation aggregation Merged 8.0.x
#15687 (PR-H) grails-jacoco plugin + Codecov coverage Merged feat/grails-code-analysis-plugin (PR-G)
#15688 (PR-I) grails.gorm.tests -> grails.gorm.specs rename Draft 8.0.x

Brings PR-F (#15689, the grails-hibernate5-micronaut-bom split) back onto the
hibernate7 staging branch and reconciles it with the hibernate7 clone. Every
conflict was resolved as the union of the incoming hibernate5 variant (from
8.0.x) and the existing hibernate7 staging variant:

- settings.gradle: include both grails-hibernate5/7-micronaut-bom, both
  micronaut-hibernate5/7 test examples, and their project dirs
- dependencies.gradle: keep the grails-hibernate7-micronaut-bom BOM block and
  widen the main block to also cover grails-hibernate5-micronaut-bom
- publish-root-config.gradle: publish grails-hibernate7-bom and both micronaut BOMs
- rat-root-config.gradle: keep the hibernate5/7 build-dir excludes
- GrailsDependencyValidatorPlugin: treat grails-hibernate7-bom and
  grails-hibernate5-micronaut-bom as BOM projects
- GrailsGradlePlugin.validateMicronautBom: accept grails-micronaut-bom plus both
  hibernate-specific micronaut BOMs
- docs (micronaut.adoc, upgrading80x.adoc): document both the hibernate5 and
  hibernate7 micronaut BOMs

Verified with `./gradlew help`: the full project graph configures, both micronaut
BOMs publish, and both micronaut-hibernate test examples pass BOM validation.

Assisted-by: claude-code:claude-opus-4-8
…hibernate7 clone

The grails-hibernate7-micronaut-bom clone and its micronaut-hibernate7 sample
were created before PR-F (#15689) refined the hibernate5 Micronaut BOM, so two
hibernate5 fixes never reached the hibernate7 clone. Merging 8.0.x back in -
which added grails-hibernate7-micronaut-bom to the dependency validator's
recognized BOMs - surfaced the gap.

- grails-bom/hibernate7-micronaut/build.gradle: exclude tools.jackson from the
  re-exported Micronaut platform, mirroring 31ec106 on the hibernate5 BOM.
  Without it, micronaut-platform's jackson-bom (3.1.0) shadows the version
  spring-boot-dependencies manages (3.1.2), and
  :grails-test-examples-micronaut-hibernate7:validateDependencyVersions fails.
  Verified passing after the fix.
- micronaut-hibernate7 ApplicationStartupSpec: assert the rendered page title
  instead of the always-true `title || true`, mirroring 35527d8.

Assisted-by: claude-code:claude-opus-4-8
jdaugherty pushed a commit to codeconsole/grails-core that referenced this pull request Jun 3, 2026
…cross TCK specs

Introduces a small helper method on the TCK base manager that replaces
the slightly awkward `manager.domainClasses.addAll([...])` pattern with
`manager.addAllDomainClasses([...])`. The implementation is one line
that delegates to the existing list mutation.

Mechanically replaces all 181 callers across:
- grails-datamapping-tck/src/main/... (13 TCK base specs + 1 manager method definition)
- grails-datamapping-core-test/src/test/... (49 core test specs)
- grails-data-hibernate5/core/src/test/... (27 hibernate5 specs)
- grails-data-mongodb/core/src/test/... (92 mongo specs)

182 files changed total: the helper method definition plus 181 call sites.

The previous form required the caller to know that `domainClasses` was a
mutable list on the manager, which leaked an implementation detail. The
helper hides the field access and makes the call site read more naturally.

This change was originally pulled forward into the hibernate7 staging
branch (PR apache#15654 commit ed0916d) and was flagged by reviewers as
unrelated to the Hibernate 7 clone. Extracting it here so it can land
on 8.0.x on its own merits as a prerequisite for the Hibernate 7 work.

Once merged here, the corresponding "Pull forward manager.addAllDomainClasses
change" commit on the hibernate7 staging branch should be removed since
it will arrive through the next merge of 8.0.x.

Assisted-by: claude-code:claude-4.7-opus
jdaugherty added a commit to codeconsole/grails-core that referenced this pull request Jun 3, 2026
Splits static code analysis out of the code-style plugin into a dedicated
grails-code-analysis convention plugin (PMD + SpotBugs), and adds a
root-only grails-violation-aggregation plugin that consolidates the
per-module Checkstyle/CodeNarc/PMD XML reports into Markdown summaries
under build/reports/violations/ via an aggregateStyleViolations task.

Extracted from the Hibernate 7 staging branch (PR apache#15654) so it can be
reviewed as a focused, single-topic change against 8.0.x, per review
feedback that the analysis tooling should land in its own PR.

Includes:

- GrailsCodeAnalysisPlugin + GrailsCodeAnalysisExtension
- GrailsViolationAggregationPlugin (aggregateStyleViolations)
- GrailsCodeStylePlugin improvements: enable/disable properties,
  codenarcFix task, test-styling toggle; resource path renamed to
  grails-code-style, PMD config under grails-code-analysis
- codeanalysis.yml workflow; codestyle.yml switched to aggregated reports
- pmd/spotbugs versions; violation-fixer skill
- Applies grails-code-analysis to 96 subprojects and wires forge

Assisted-by: claude-code:claude-4.7-opus
jamesfredley pushed a commit to codeconsole/grails-core that referenced this pull request Jun 3, 2026
Adds a grails-jacoco convention plugin that configures JaCoCo per subproject
and registers a root jacocoAggregateReport task producing a single XML report
for Codecov, handling the hibernate5/hibernate7 duplicate-class case. Applies
grails-jacoco to 96 subprojects and adds the Coverage workflow that uploads to
the existing codecov.yml configuration.

Layers on top of PR-G (grails-code-analysis / grails-violation-aggregation),
which provides the build-logic test infrastructure and plugin registration
scaffold. Folds in the standalone coverage work from apache#15668.

Extracted from the Hibernate 7 staging branch (PR apache#15654) per review feedback
that JaCoCo should be introduced as its own focused PR for the project to
review independently.

Assisted-by: claude-code:claude-4.7-opus
Reconciles the stage branch with the carved-out PRs that have now landed on
8.0.x. The revert commits previously applied here (async/TCK-helper revert
ba235da, code-analysis+jacoco revert 33412ee, h5 Micronaut BOM +
tests->specs revert f0d82f6) combine with the incoming carved changes so the
shared, hibernate5 and datamapping trees resolve to their finalized end state.

Conflict resolution principle: shared/non-h7 files take the finalized 8.0.x
content (PR-C registerDomainClasses, cleaned domain lists, codenarc style,
upstream test-behavior fixes), while the stage branch's hibernate7-specific
adaptations are preserved on top:

- PR-C helper migration (domainClasses.addAll/addAllDomainClasses ->
  registerDomainClasses): take 8.0.x across the TCK, datamapping-core-test and
  hibernate5/core test trees. PR-D (DetachedCriteria command-chain style) and
  PR-E (Mongo base spec + package rename) were rejected and are absent from
  8.0.x, so they do not return.
- hibernate7 TCK skips preserved: re-applied System.getProperty('hibernate7.
  gorm.suite') to the @IgnoreIf/@PendingFeatureIf predicates on GroovyProxySpec
  (renamed dead hibernate6 -> hibernate7), NullValueEqualSpec, OptimisticLocking
  Spec, PagedResultSpec and ValidationSpec, which take-theirs had dropped. No
  hibernate6.gorm.suite references remain in the TCK.
- Event specs (QueryEventsSpec, SessionCreationEventSpec): kept the stage
  branch's deliberate contextAvailable guard (run-with-guard rather than skip)
  while adopting 8.0.x's registerDomainClasses and cleaned domain list.
- hibernate5/core structural changes kept (Hibernate5* spec renames, the
  grails.gorm.tests.entities subpackage); DetachedCriteriaJoinSpec takes 8.0.x's
  finalized body (incl. the new LEFT-JOIN subquery test) with the entities
  imports restored.

grails-data-hibernate7/** is not on 8.0.x, so h7-only files keep ours and carry
no changes in this merge. The h7 mirror pass (registerDomainClasses on the h7
test tree, plus the grails-jacoco apply-line and PMD/SpotBugs gradle.properties
on the h7 modules) follows in dedicated commits.

Verified: compileTestGroovy passes for grails-data-hibernate5-core,
grails-datamapping-core-test, grails-datamapping-tck and grails-data-mongodb-core.

Assisted-by: claude-code:claude-opus-4-8
…tree

PR-C (#15683) renamed the TCK helper addAllDomainClasses to
registerDomainClasses and migrated callers to varargs. It made
GrailsDataTckManager.domainClasses private, so the old
manager.domainClasses.addAll([...]) form no longer compiles. PR-C landed on
8.0.x but could not touch the grails-data-hibernate7 clone (it does not exist
on 8.0.x), so merging 8.0.x back left the h7 core test tree broken.

This mirrors PR-C's API migration across the 27 affected h7 specs:
manager.domainClasses.addAll([A, B]) -> manager.registerDomainClasses(A, B).
Only the registration call changes; the registered classes are unchanged.

Verified: ./gradlew :grails-data-hibernate7-core:compileTestGroovy passes.

Assisted-by: claude-code:claude-opus-4-8
PR-H (#15687) applies the grails-jacoco convention plugin per-module across the
build (all grails-data-hibernate5/* modules included). It landed on 8.0.x but
could not touch the grails-data-hibernate7 clone, so merging 8.0.x back left the
h7 modules without coverage instrumentation.

This adds the grails-jacoco apply-line to the six h7 modules (boot-plugin, core,
dbmigration, dbmigration-core, grails-plugin, spring-orm) so each matches its
hibernate5 counterpart (grails-code-style + grails-jacoco). The finalized
carve-out does not apply grails-code-analysis per-module (it is registered and
applied at the root via grails-violation-aggregation) and keeps no per-module
PMD/SpotBugs gradle.properties, so neither is added here - the h7 modules mirror
the h5 modules exactly.

Verified: ./gradlew :grails-data-hibernate7-core:compileTestGroovy configures and
compiles cleanly with grails-jacoco applied.

Assisted-by: claude-code:claude-opus-4-8
…I now requires

Completes the PR-C mirror. The merged GrailsDataTckManager makes domainClasses a
private set with an empty default, so every spec must register the classes it
uses via registerDomainClasses(...). The earlier mirror migrated the 27 specs
using manager.domainClasses.addAll([...]), but two specs used other patterns and
were missed - the full pre-PR test run surfaced them:

- HibernateOptimisticLockingSpec had no setupSpec (it relied on the old manager's
  non-empty default set). Added setupSpec registering OptLockVersioned and
  OptLockNotVersioned, matching Hibernate5OptimisticLockingSpec.
- HibernateValidationSpec used `manager.domainClasses += [...]` (compound-assign,
  now a ReadOnlyPropertyException). Switched to registerDomainClasses(...) with
  the full class list (TestEntity, ChildEntity included, since the default is
  empty), matching the hibernate5 HibernateValidationSpec.

Verified: ./gradlew :grails-data-hibernate7-core:test now passes
(571 tests, 0 failures, 26 skipped); all four violation reports are clean.

Assisted-by: claude-code:claude-opus-4-8
@jamesfredley

Copy link
Copy Markdown
Contributor

Merge-back + Hibernate 7 mirror pass complete

8.0.x has been merged into this branch and the post-merge Hibernate 7 mirror pass applied. Pushed as four commits:

Commit What
9c17ce7870 Merge 8.0.x into 8.0.x-stage-hibernate7
5549cece1c Mirror PR-C registerDomainClasses onto the 27 hibernate7 test specs
7931bc72a6 Mirror PR-H grails-jacoco onto the 6 hibernate7 modules
637da9ce75 Register domain classes in two h7 specs the new TCK API requires

Merge-back

The carved PRs that landed on 8.0.x returned through the merge - B (async cleanup), C (registerDomainClasses), F (h5 Micronaut BOM), G (code-analysis), H (jacoco). The ones we declined stayed out - D (DetachedCriteria command-chain style), E (Mongo base spec / package rename), I (tests -> specs).

Conflict resolution took the finalized 8.0.x content for the shared / hibernate5 / datamapping trees, while preserving the hibernate7-specific adaptations that a blunt "take theirs" would have dropped:

  • hibernate7.gorm.suite @IgnoreIf / @PendingFeatureIf skips on the shared TCK specs (GroovyProxySpec, NullValueEqualSpec, OptimisticLockingSpec, PagedResultSpec, ValidationSpec), plus the dead hibernate6 -> hibernate7 rename;
  • the deliberate contextAvailable guard on QueryEventsSpec / SessionCreationEventSpec (kept, but adopting 8.0.x's registerDomainClasses);
  • the Hibernate5* spec renames and the grails.gorm.tests.entities subpackage (re-added the entity imports DetachedCriteriaJoinSpec lost when it took the finalized 8.0.x body with the new LEFT-JOIN subquery test).

Hibernate 7 mirror pass (what 8.0.x cannot carry)

Because the grails-data-hibernate7 clone does not exist on 8.0.x, three carve-outs had to be mirrored here after the merge-back:

  • PR-C (5549cece1c): the merged GrailsDataTckManager makes domainClasses a private set with an empty default, so manager.domainClasses.addAll([...]) no longer compiles. Migrated the 27 affected h7 specs to registerDomainClasses(...). Two more specs used patterns the bulk migration didn't match (no setupSpec; domainClasses +=) and are fixed in 637da9ce75 (HibernateOptimisticLockingSpec, HibernateValidationSpec) to match their hibernate5 counterparts.
  • PR-H (7931bc72a6): added the grails-jacoco apply-line to the six h7 modules so each matches its hibernate5 counterpart. grails-code-analysis is intentionally not applied per-module - the finalized carve-out applies it only at the root via grails-violation-aggregation, and no per-module PMD/SpotBugs gradle.properties exist - so none were added here.
  • PR-F (Micronaut BOM) was already mirrored earlier in 76123ad48a; PR-B has no hibernate7 footprint.

Verification

./gradlew clean aggregateViolations :grails-test-report:check --continue -> BUILD SUCCESSFUL:

  • aggregated tests: 9366 run, 0 failures, 0 errors, 241 skipped;
  • :grails-data-hibernate7-core:test: 571 run, 0 failures, 26 skipped (the @IgnoreIf(hibernate7.gorm.suite) ones);
  • all four violation reports (Checkstyle, CodeNarc, PMD, SpotBugs): No violations found.

@testlens-app

This comment has been minimized.

@codecov

codecov Bot commented Jun 3, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 48.3378%. Comparing base (4836003) to head (bb990dc).
⚠️ Report is 91 commits behind head on 8.0.x.

Additional details and impacted files

Impacted file tree graph

@@                Coverage Diff                 @@
##                8.0.x     #15654        +/-   ##
==================================================
- Coverage     49.0042%   48.3378%   -0.6664%     
+ Complexity      16759      15097      -1662     
==================================================
  Files            2014       1870       -144     
  Lines           94747      85457      -9290     
  Branches        16547      14900      -1647     
==================================================
- Hits            46430      41308      -5122     
+ Misses          41019      37815      -3204     
+ Partials         7298       6334       -964     

see 154 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@borinquenkid borinquenkid left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@matrei matrei left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not particularly happy about some of the test re-formatting, but let's move on in the name of time.

push:
branches:
- '[0-9]+.[0-9]+.x'
- '8.0.x-hibernate7.*'

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should not be necessary, the pull_request: below should trigger running the workflow.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's here because I pulled forward the changes - my assumption is we'll remove in step 2 PR. When chaining PRs together, the later PRs won't run unless in this list.

- '[4-9]+.[0-9]+.x'
- '8.0.x-hibernate7.*'
pull_request:
# The branches below must be a subset of the branches above

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm, I wonder why we are filtering pull_request target branches?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm assuming because actions have finite limits and we didn't want it running until a PR was opened against the main branch? I'm not sure though, I think we should revisit this in the weekly.

- '[0-9]+.[0-9]+.x'
- '8.0.x-hibernate7.*'
pull_request:
branches:

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder why we are filtering pull_request target branches?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See previous answer.

Comment thread .github/workflows/rat.yml
- '[0-9]+.[0-9]+.x'
- '8.0.x-hibernate7.*'
pull_request:
branches:

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder why we are filtering pull_request target branches?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See previous answer.

*/
class HibernateSpecSpec extends HibernateSpec {


Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I removed the blank line.

class QueryEventsSpec extends GrailsDataTckSpec {

SpecQueryEventListener listener
boolean contextAvailable = false

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should document why this property is necessary.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Documentation added.

class SessionCreationEventSpec extends GrailsDataTckSpec {

@Override
Listener listener
boolean contextAvailable = false

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Document?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

documentation added

/**
* Tests for GORM Criteria Queries - both createCriteria() and DetachedCriteria.
*
* Criteria queries provide a type-safe, programmatic way to build
* complex queries without writing HQL strings.
*/
@Rollback
@Integration
@Integration(applicationClass = Application)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why was (applicationClass = Application) added?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's not needed, so I'll remove it.

@jdaugherty

Copy link
Copy Markdown
Contributor Author

@matrei I agree on the styling changes, but in an effort to merge this I'd like to address this in a future PR. @jamesfredley already created a ticket to document the need to apply styling to our tests.

As for the workflow changes, they can be reverted once we merge this PR in the step 2.

I believe I've implemented all feedback and we seem to have multiple approvals. I'm going to merge this PR and then we can iterate on it.

@jdaugherty jdaugherty merged commit 098660a into 8.0.x Jun 4, 2026
31 of 36 checks passed
@github-project-automation github-project-automation Bot moved this from In Progress to Done in Apache Grails Jun 4, 2026
@jdaugherty jdaugherty deleted the 8.0.x-stage-hibernate7 branch June 4, 2026 20:08
jamesfredley added a commit that referenced this pull request Jun 4, 2026
Forward-merge the 8.0.x base (hibernate7 staging module #15654 plus the
pull-forward commits) into the Groovy 5 / Spring Boot 4 branch.

Conflicts (4):
- .github/workflows/groovy-joint-workflow.yml: kept the branch's
  --init-script groovy-joint-build.init.gradle hook on the pTML step.
- build-logic/plugins/.../SbomPlugin.groovy: kept the branch's superset of
  CycloneDX license-exception mappings (antlr4-runtime, the org.jline:*@3.30.9
  family, liquibase-hibernate5) alongside 8.0.x's jzlib entry.
- grails-test-suite-uber/.../DomainClassWithInnerClassUsingStaticCompilationSpec.groovy:
  took 8.0.x's removal of the namedQueries closure (deprecated feature removed
  on 8.0.x; the corresponding field and test method were already dropped by the
  auto-merge, so the closure was orphaned).
- grails-data-hibernate7/core/.../HibernateEventListeners.java: accepted 8.0.x's
  hibernate7 staging file (false rename/delete pairing with a deleted
  logback.groovy).

Assisted-by: claude-code:claude-4.8-opus
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

5 participants